package model;

import java.util.Random;

/**
 * 
 * @author Estelle && Marie
 *
 *	This function is used to set variables for a simulation
 *
 */

public class BinSetVariables {
	
	private String CallPutFlag;
	private double S, X, T, r, b, v;
	private int nSteps, nSimulations;
	private double dt;
	private double Drift, vSqrdt;
	private Random random = new Random(1);

//--------------------------------------------------------------------------------------------------------------------------------------------------------		
	/**
	 * the default constructor
	 * 
	 */
	public BinSetVariables(){
		
		this.CallPutFlag= "c";
		this.S=40;
		this.X=50;
		this.T=0.5;
		this.r=0.06;
		this.b=0.10;
		this.v=0.45;
		this.nSteps =  168;
		this.nSimulations= 100000;
		
		// Initialize the variables
		
		this.dt = this.T/this.nSteps;
		
		this.Drift = (this.b- Math.pow(this.v, 2) /2)*this.dt;
		this.vSqrdt = v*Math.sqrt(this.dt);
	}
	
//--------------------------------------------------------------------------------------------------------------------------------------------------------		
	/**
	 * The constructor
	 * 
	 * @param CallPutFlag
	 * @param S
	 * @param X
	 * @param T
	 * @param r
	 * @param b
	 * @param v
	 * @param nSteps
	 * @param nSimulations
	 */
	public BinSetVariables(String CallPutFlag, double S, double  X, double T, double r, double b, double v, int nSteps, int nSimulations){
		
		this.CallPutFlag= CallPutFlag;
		this.S=S;
		this.X=X;
		this.T=T;
		this.r=r;
		this.b=b;
		this.v=v;
		this.nSteps = nSteps;
		this.nSimulations=nSimulations;
		
		// Initialize the variables
		
		this.dt = this.T/this.nSteps;
		
		this.Drift = (this.b- Math.pow(this.v, 2) /2)*this.dt;
		this.vSqrdt = v*Math.sqrt(this.dt);
	}
	
//--------------------------------------------------------------------------------------------------------------------------------------------------------		
	/**
	 * Getter and the Setter for each elements
	 */
	public String getCallPutFlag() {
		return CallPutFlag;
	}

	public void setCallPutFlag(String callPutFlag) {
		CallPutFlag = callPutFlag;
	}

	public double getS() {
		return S;
	}

	public void setS(double s) {
		S = s;
	}

	public double getX() {
		return X;
	}

	public void setX(double x) {
		X = x;
	}

	public double getT() {
		return T;
	}

	public void setT(double t) {
		T = t;
	}

	public double getR() {
		return r;
	}

	public void setR(double r) {
		this.r = r;
	}

	public double getB() {
		return b;
	}

	public void setB(double b) {
		this.b = b;
	}

	public double getV() {
		return v;
	}

	public void setV(double v) {
		this.v = v;
	}

	public int getnSteps() {
		return nSteps;
	}

	public void setnSteps(int nSteps) {
		this.nSteps = nSteps;
	}

	public int getnSimulations() {
		return nSimulations;
	}

	public void setnSimulations(int nSimulations) {
		this.nSimulations = nSimulations;
	}

	public double getDt() {
		return dt;
	}

	public void setDt(double dt) {
		this.dt = dt;
	}

	public double getDrift() {
		return Drift;
	}

	public void setDrift(double drift) {
		Drift = drift;
	}

	public double getvSqrdt() {
		return vSqrdt;
	}

	public void setvSqrdt(double vSqrdt) {
		this.vSqrdt = vSqrdt;
	}

	public Random getRandom() {
		return random;
	}

	public void setRandom(Random random) {
		this.random = random;
	}



}
